package com.tywj.buscustomerapp.view.item;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.tywj.buscustomerapp.R;
import com.tywj.buscustomerapp.utils.myadapter.item.AdapterItem;

public class ScenicItem implements AdapterItem<String> {
    TextView top;
    ImageView topimg;

    @Override
    public int getLayoutResId() {
        return R.layout.item_scenic;
    }

    @Override
    public void bindViews(@NonNull View root) {
        top = root.findViewById(R.id.top);
        topimg = root.findViewById(R.id.top1);
    }

    @Override
    public void setViews() {

    }

    @Override
    public void handleData(String s, int position) {
        topimg.setVisibility(View.VISIBLE);
        if (position==0){
            top.setVisibility(View.GONE);
            topimg.setImageResource(R.mipmap.no1);
        }else if (position==1){
            top.setVisibility(View.GONE);
            topimg.setImageResource(R.mipmap.no2);
        }else if (position==2){
            top.setVisibility(View.GONE);
            topimg.setImageResource(R.mipmap.no3);
        }else{
            topimg.setVisibility(View.GONE);
            top.setVisibility(View.VISIBLE);
            top.setText("TOP "+(position+1));
        }
    }
}
